package priv.pront.code.robot.robCom_pri_2022;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

/**
 * @Description:
 * @Author: pront
 * @Time:2023-06-30 14:47
 */
public class RC_v3_智能监测 {

    static BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
    static int n, m;
    static List<String> list = new ArrayList<>();
    public static void main(String[] args) throws IOException {
        String[] s = bf.readLine().split(" ");
        n = Integer.parseInt(s[0]);
        m = Integer.parseInt(s[1]);
        for (int i = 0; i < n; i++) {
            String ss = bf.readLine();
            list.add(ss);
        }

        for (String s1 : list) {
            String[] s2 = s1.split(" ");
            int number = Integer.parseInt(s2[1]);
            if(number > 80 + m || number < 80 - m){
                System.out.println(s1);
            }

        }
    }



}
